package com.example;

import com.baidu.disconf.core.common.utils.ClassLoaderUtil;
import com.example.config.CodeConfig;
import com.example.config.DBConfig;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) throws InterruptedException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        CodeConfig config = (CodeConfig) context.getBean("codeConfig");
        DBConfig dbConfig = (DBConfig) context.getBean("dbConfig");
        System.out.println("class path ---------" + ClassLoaderUtil.getClassPath());
        System.out.println("class loader  ---------" + ClassLoaderUtil.getLoader());
        while (true) {
            System.out.println("---------->" + config.getCodeError() + "--" +dbConfig.getCodeError());
            config.getUrl();
            Thread.sleep(1000);
        }
    }
}
